home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / XAMPP 1.4.14 / xampp-win32-1.4.14-installer.exe / xampp / php / pear / HTML / Progress / generator.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  23.9 KB  |  545 lines

  1. <?php
  2. // +----------------------------------------------------------------------+
  3. // | PHP Version 4                                                        |
  4. // +----------------------------------------------------------------------+
  5. // | Copyright (c) 1997-2004 The PHP Group                                |
  6. // +----------------------------------------------------------------------+
  7. // | This source file is subject to version 3.0 of the PHP license,       |
  8. // | that is bundled with this package in the file LICENSE, and is        |
  9. // | available at through the world-wide-web at                           |
  10. // | http://www.php.net/license/3_0.txt.                                  |
  11. // | If you did not receive a copy of the PHP license and are unable to   |
  12. // | obtain it through the world-wide-web, please send a note to          |
  13. // | license@php.net so we can mail you a copy immediately.               |
  14. // +----------------------------------------------------------------------+
  15. // | Author: Laurent Laville <pear@laurent-laville.org>                   |
  16. // +----------------------------------------------------------------------+
  17. //
  18. // $Id: generator.php,v 1.1 2004/02/13 15:39:06 farell Exp $
  19.  
  20. require_once 'HTML/QuickForm/Controller.php';
  21. require_once 'HTML/QuickForm/Action/Submit.php';
  22. require_once 'HTML/QuickForm/Action/Jump.php';
  23. require_once 'HTML/QuickForm/Action/Display.php';
  24. require_once 'HTML/QuickForm/Action/Direct.php';
  25.  
  26. require_once 'HTML/Progress/Error/Raise.php';
  27. require_once 'HTML/Progress.php';
  28. require_once 'HTML/Progress/generator/pages.php';
  29.  
  30. require_once 'HTML/CSS.php';
  31.  
  32. /**
  33.  * The HTML_Progress_Generator class provides an easy way to 
  34.  * dynamic build Progress bar, show a preview, 
  35.  * and save php/css code for a later reuse.
  36.  *
  37.  * @version    1.1
  38.  * @author     Laurent Laville <pear@laurent-laville.org>
  39.  * @access     public
  40.  * @category   HTML
  41.  * @package    HTML_Progress
  42.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  43.  */
  44.  
  45. class HTML_Progress_Generator extends HTML_QuickForm_Controller 
  46. {
  47.     /**#@+
  48.      * Attributes of wizard form.
  49.      *
  50.      * @var        mixed
  51.      * @since      1.1
  52.      * @access     private
  53.      */
  54.     var $_buttonBack   = '<< Back';
  55.     var $_buttonNext   = 'Next >>';
  56.     var $_buttonCancel = 'Cancel';
  57.     var $_buttonReset  = 'Reset';
  58.     var $_buttonApply  = 'Preview';
  59.     var $_buttonSave   = 'Save';
  60.     var $_buttonAttr   = array('style'=>'width:80px;');
  61.     /**#@-*/
  62.  
  63.     /**
  64.      * Tabs element of wizard form.
  65.      *
  66.      * @var        array
  67.      * @since      1.1
  68.      * @access     private
  69.      */
  70.     var $_tabs;
  71.  
  72.  
  73.     /**
  74.      * Constructor Summary
  75.      *
  76.      * o Creates a standard progress bar generator wizard.
  77.      *   <code>
  78.      *   $generator = new HTML_Progress_Generator();
  79.      *   </code>
  80.      *
  81.      * o Creates a progress bar generator wizard with 
  82.      *   customized actions: 
  83.      *   <ul>
  84.      *   <li>your progress bar preview.
  85.      *   <li>HTML_Progress_Generator form rendering (wizard display)
  86.      *   <li>save and cancel actions manager.
  87.      *   </ul>
  88.      *   <code>
  89.      *   $attributes = array(
  90.      *        'preview' => name of a HTML_QuickForm_Action instance 
  91.      *                     (default 'ActionPreview', see 'HTML/Progress/generator/preview.php')
  92.      *        'display' => name of a HTML_QuickForm_Action_Display instance
  93.      *                     (default 'ActionDisplay', see 'HTML/Progress/generator/default.php')
  94.      *        'process' => name of a HTML_QuickForm_Action instance 
  95.      *                     (default 'ActionProcess', see 'HTML/Progress/generator/process.php')
  96.      *   );
  97.      *   $generator = new HTML_Progress_Generator($attributes);
  98.      *   </code>
  99.      *
  100.      * @param      string    $controllerName(optional) Name of generator wizard (QuickForm)
  101.      * @param      array     $attributes    (optional) List of renderer options
  102.      *
  103.      * @since      1.1
  104.      * @access     public
  105.      * @throws     HTML_PROGRESS_ERROR_INVALID_INPUT
  106.      */
  107.     function HTML_Progress_Generator($controllerName = 'ProgressGenerator', $attributes = array())
  108.     {
  109.         $this->_package = 'HTML_Progress_Generator';
  110.         Error_Raise::initialize($this->_package, array('HTML_Progress', '_getErrorMessage'));
  111.  
  112.         if (!is_string($controllerName)) {
  113.             return Error_Raise::raise($this->_package, HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  114.                 array('var' => '$controllerName',
  115.                       'was' => gettype($controllerName),
  116.                       'expected' => 'string',
  117.                       'paramnum' => 1), PEAR_ERROR_TRIGGER);
  118.  
  119.         } elseif (!is_array($attributes)) {
  120.             return Error_Raise::raise($this->_package, HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  121.                 array('var' => '$attributes',
  122.                       'was' => gettype($attributes),
  123.                       'expected' => 'array',
  124.                       'paramnum' => 2), PEAR_ERROR_TRIGGER);
  125.         }
  126.         parent::HTML_QuickForm_Controller($controllerName,false);
  127.  
  128.         // Check if Action(s) are customized
  129.         $ActionPreview = isset($attributes['preview'])? $attributes['preview']: 'ActionPreview';
  130.         $ActionDisplay = isset($attributes['display'])? $attributes['display']: 'ActionDisplay';
  131.         $ActionProcess = isset($attributes['process'])? $attributes['process']: 'ActionProcess';
  132.  
  133.         $this->_tabs = array(
  134.             0 => array('page1', 'Property1', 'Progress'),
  135.             1 => array('page2', 'Property2', 'Cell'),
  136.             2 => array('page3', 'Property3', 'Border'),
  137.             3 => array('page4', 'Property4', 'String'),
  138.             4 => array('page5', 'Preview',   'Preview'),
  139.             5 => array('page6', 'Save',      'Save')
  140.         );
  141.  
  142.         foreach ($this->_tabs as $tab) {
  143.             list($pageName, $className, $tabName) = $tab;
  144.             // Add each tab of the wizard
  145.             $this->addPage(new $className($pageName));
  146.  
  147.             // These actions manage going directly to the pages with the same name
  148.             $this->addAction($pageName, new HTML_QuickForm_Action_Direct());
  149.         }
  150.         $preview =& $this->getPage('page5');
  151.  
  152.         // The customized actions
  153.         if (!class_exists($ActionPreview)) {
  154.             include_once 'HTML/Progress/generator/preview.php';
  155.             $ActionPreview = 'ActionPreview';
  156.         }
  157.         if (!class_exists($ActionDisplay)) {
  158.             include_once 'HTML/Progress/generator/default.php';
  159.             $ActionDisplay = 'ActionDisplay';
  160.         }
  161.         if (!class_exists($ActionProcess)) {
  162.             include_once 'HTML/Progress/generator/process.php';
  163.             $ActionProcess = 'ActionProcess';
  164.         }
  165.         $preview->addAction('apply', new $ActionPreview());
  166.         $this->addAction('display', new $ActionDisplay());
  167.         $this->addAction('process', new $ActionProcess());
  168.         $this->addAction('cancel',  new $ActionProcess());
  169.  
  170.         // set ProgressBar default values on first run
  171.         $sess = $this->container();
  172.         $defaults = $sess['defaults'];
  173.  
  174.         if (count($sess['defaults']) == 0) {
  175.             $this->setDefaults(array(
  176.                 'progressclass' => 'progressBar',
  177.                 'shape'         => HTML_PROGRESS_BAR_HORIZONTAL,
  178.                 'way'           => 'natural',
  179.                 'autosize'      => true,
  180.                 'progresssize'  => array('bgcolor' => '#FFFFFF'),
  181.                 'rAnimSpeed'    => 100,
  182.     
  183.                 'borderpainted' => false,
  184.                 'borderclass'   => 'progressBarBorder',
  185.                 'borderstyle'   => array('style' => 'solid', 'width' => 0, 'color' => '#000000'),
  186.  
  187.                 'cellid'        => 'progressCell%01s',
  188.                 'cellclass'     => 'cell',
  189.                 'cellvalue'     => array('min' => 0, 'max' => 100, 'inc' => 1),
  190.                 'cellsize'      => array('width' => 15, 'height' => 20, 'spacing' => 2, 'count' => 10),
  191.                 'cellcolor'     => array('active' => '#006600', 'inactive' => '#CCCCCC'),
  192.                 'cellfont'      => array('family' => 'Courier, Verdana', 'size' => 8, 'color' => '#000000'),
  193.  
  194.                 'stringpainted' => false,
  195.                 'stringid'      => 'installationProgress',
  196.                 'stringsize'    => array('width' => 50, 'height' => '', 'bgcolor' => '#FFFFFF'),
  197.                 'stringvalign'  => 'right',
  198.                 'stringalign'   => 'right',
  199.                 'stringfont'    => array('family' => 'Verdana, Arial, Helvetica, sans-serif', 'size' => 12, 'color' => '#000000'),
  200.                 'strings'       => implode(";\n", array(
  201.                                        0 => '10,Hello world',
  202.                                        1 => '20,Welcome',
  203.                                        2 => '30,to',
  204.                                        3 => '40,HTML_Progress v1',
  205.                                        4 => '60,by',
  206.                                        5 => '70,Laurent Laville',
  207.                                        6 => '100,Have a nice day !'
  208.                                     )),
  209.  
  210.                 'phpcss'        => array('P'=>true)
  211.             ));
  212.         }
  213.     }
  214.  
  215.     /**
  216.      * Adds all necessary tabs to the given page object.
  217.      *
  218.      * @param      object    $page          Page where to put the button
  219.      * @param      mixed     $attributes    (optional) Either a typical HTML attribute string 
  220.      *                                      or an associative array.
  221.      * @return     void
  222.      * @since      1.1
  223.      * @access     public
  224.      * @throws     HTML_PROGRESS_ERROR_INVALID_INPUT
  225.      */
  226.     function createTabs(&$page, $attributes = null)
  227.     {
  228.         if (!is_a($page, 'HTML_QuickForm_Page')) {
  229.             return Error_Raise::raise($this->_package, HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  230.                 array('var' => '$page',
  231.                       'was' => gettype($page),
  232.                       'expected' => 'HTML_QuickForm_Page object',
  233.                       'paramnum' => 1), PEAR_ERROR_TRIGGER);
  234.  
  235.         } elseif (!is_array($attributes) && !is_string($attributes) && !is_null($attributes)) {
  236.             return Error_Raise::raise($this->_package, HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  237.                 array('var' => '$attributes',
  238.                       'was' => gettype($attributes),
  239.                       'expected' => 'array | string',
  240.                       'paramnum' => 2), PEAR_ERROR_TRIGGER);
  241.         }
  242.  
  243.         $here = $attributes = HTML_Common::_parseAttributes($attributes);
  244.         $here['disabled'] = 'disabled';
  245.         $pageName = $page->getAttribute('name');
  246.         $jump = array();
  247.  
  248.         foreach ($this->_tabs as $tab) {
  249.             list($event, $cls, $label) = $tab;
  250.             $attrs = ($pageName == $event) ? $here : $attributes;
  251.             $jump[] =& $page->createElement('submit', $page->getButtonName($event), $label, HTML_Common::_getAttrString($attrs));
  252.         }
  253.         $page->addGroup($jump, 'tabs', '', ' ', false);
  254.     }
  255.  
  256.     /**
  257.      * Adds all necessary buttons to the given page object.
  258.      *
  259.      * @param      object    $page          Page where to put the button
  260.      * @param      array     $buttons       Key/label of each button/event to handle
  261.      * @param      mixed     $attributes    (optional) Either a typical HTML attribute string 
  262.      *                                      or an associative array.
  263.      * @return     void
  264.      * @since      1.1
  265.      * @access     public
  266.      * @throws     HTML_PROGRESS_ERROR_INVALID_INPUT
  267.      */
  268.     function createButtons(&$page, $buttons, $attributes = null)
  269.     {
  270.         if (!is_a($page, 'HTML_QuickForm_Page')) {
  271.             return Error_Raise::raise($this->_package, HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  272.                 array('var' => '$page',
  273.                       'was' => gettype($page),
  274.                       'expected' => 'HTML_QuickForm_Page object',
  275.                       'paramnum' => 1), PEAR_ERROR_TRIGGER);
  276.  
  277.         } elseif (!is_array($buttons)) {
  278.             return Error_Raise::raise($this->_package, HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  279.                 array('var' => '$buttons',
  280.                       'was' => gettype($buttons),
  281.                       'expected' => 'array',
  282.                       'paramnum' => 2), PEAR_ERROR_TRIGGER);
  283.  
  284.         } elseif (!is_array($attributes) && !is_string($attributes) && !is_null($attributes)) {
  285.             return Error_Raise::raise($this->_package, HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  286.                 array('var' => '$attributes',
  287.                       'was' => gettype($attributes),
  288.                       'expected' => 'array | string',
  289.                       'paramnum' => 3), PEAR_ERROR_TRIGGER);
  290.         }
  291.  
  292.         $confirm = $attributes = HTML_Common::_parseAttributes($attributes);
  293.         $confirm['onClick'] = "return(confirm('Are you sure ?'));";
  294.  
  295.         $prevnext = array();
  296.  
  297.         foreach ($buttons as $event => $label) {
  298.             if ($event == 'cancel') {
  299.                 $type = 'submit';
  300.                 $attrs = $confirm;
  301.             } elseif ($event == 'reset') {
  302.                 $type = 'reset';
  303.                 $attrs = $confirm;
  304.             } else {
  305.                 $type = 'submit';
  306.                 $attrs = $attributes;
  307.             }
  308.             $prevnext[] =& $page->createElement($type, $page->getButtonName($event), $label, HTML_Common::_getAttrString($attrs));
  309.         }
  310.         $page->addGroup($prevnext, 'buttons', '', ' ', false);
  311.     }
  312.  
  313.     /**
  314.      * Enables certain buttons for a page.
  315.      * 
  316.      * Buttons [ = events] : back, next, cancel, reset, apply, help
  317.      * 
  318.      * @param      object    $page          Page where you want to activate buttons
  319.      * @param      array     $events        (optional) List of buttons
  320.      *
  321.      * @since      1.1
  322.      * @access     public
  323.      * @throws     HTML_PROGRESS_ERROR_INVALID_INPUT
  324.      * @see        disableButton()
  325.      */  
  326.     function enableButton(&$page, $events = array()) 
  327.     {
  328.         if (!is_a($page, 'HTML_QuickForm_Page')) {
  329.             return Error_Raise::raise($this->_package, HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  330.                 array('var' => '$page',
  331.                       'was' => gettype($page),
  332.                       'expected' => 'HTML_QuickForm_Page object',
  333.                       'paramnum' => 1), PEAR_ERROR_TRIGGER);
  334.  
  335.         } elseif (!is_array($events)) {
  336.             return Error_Raise::raise($this->_package, HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  337.                 array('var' => '$events',
  338.                       'was' => gettype($events),
  339.                       'expected' => 'array',
  340.                       'paramnum' => 2), PEAR_ERROR_TRIGGER);
  341.         }
  342.         static $all;
  343.         if (!isset($all)) {
  344.             $all = array('back','next','cancel','reset','apply','help');
  345.         }
  346.         $buttons = (count($events) == 0) ? $all : $events;
  347.  
  348.         foreach ($buttons as $event) {
  349.             $group    =& $page->getElement('buttons');
  350.             $elements =& $group->getElements();
  351.             foreach (array_keys($elements) as $key) {
  352.                 if ($group->getElementName($key) == $page->getButtonName($event)) {
  353.                     $elements[$key]->updateAttributes(array('disabled'=>'false'));
  354.                 }
  355.             }
  356.         }
  357.     }
  358.  
  359.     /**
  360.      * Disables certain buttons for a page.
  361.      * 
  362.      * Buttons [ = events] : back, next, cancel, reset, apply, help
  363.      * 
  364.      * @param      object    $page          Page where you want to activate buttons
  365.      * @param      array     $events        (optional) List of buttons
  366.      *
  367.      * @since      1.1
  368.      * @access     public
  369.      * @throws     HTML_PROGRESS_ERROR_INVALID_INPUT
  370.      * @see        enableButton()
  371.      */  
  372.     function disableButton(&$page, $events = array()) 
  373.     {
  374.         if (!is_a($page, 'HTML_QuickForm_Page')) {
  375.             return Error_Raise::raise($this->_package, HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  376.                 array('var' => '$page',
  377.                       'was' => gettype($page),
  378.                       'expected' => 'HTML_QuickForm_Page object',
  379.                       'paramnum' => 1), PEAR_ERROR_TRIGGER);
  380.  
  381.         } elseif (!is_array($events)) {
  382.             return Error_Raise::raise($this->_package, HTML_PROGRESS_ERROR_INVALID_INPUT, 'exception',
  383.                 array('var' => '$events',
  384.                       'was' => gettype($events),
  385.                       'expected' => 'array',
  386.                       'paramnum' => 2), PEAR_ERROR_TRIGGER);
  387.         }
  388.         static $all;
  389.         if (!isset($all)) {
  390.             $all = array('back','next','cancel','reset','apply','help');
  391.         }
  392.         $buttons = (count($events) == 0) ? $all : $events;
  393.  
  394.         foreach ($buttons as $event) {
  395.             $group    =& $page->getElement('buttons');
  396.             $elements =& $group->getElements();
  397.             foreach (array_keys($elements) as $key) {
  398.                 if ($group->getElementName($key) == $page->getButtonName($event)) {
  399.                     $elements[$key]->updateAttributes(array('disabled'=>'true'));
  400.                 }
  401.             }
  402.         }
  403.     }
  404.  
  405.     /**
  406.      * Creates a progress bar with options choosen on all wizard tabs.
  407.      *
  408.      * @since      1.1
  409.      * @access     public
  410.      */
  411.     function createProgressBar()
  412.     {
  413.         $progress = $this->exportValues();
  414.         
  415.         $bar = new HTML_Progress();
  416.         $bar->setIdent('PB1');
  417.         $bar->setAnimSpeed(intval($progress['rAnimSpeed']));
  418.  
  419.         if ($progress['model'] != '') {
  420.             $bar->setModel($progress['model'], 'iniCommented');
  421.             $bar->setIncrement(10);
  422.             $ui =& $bar->getUI();
  423.         } else {
  424.             $bar->setBorderPainted(($progress['borderpainted'] == '1'));
  425.             $bar->setStringPainted(($progress['stringpainted'] == '1'));
  426.             $ui =& $bar->getUI();      
  427.         
  428.             $structure = array();
  429.  
  430.             /* Page 1: Progress attributes **************************************************/
  431.             if (strlen(trim($progress['progressclass'])) > 0) {
  432.                 $structure['progress']['class'] = $progress['progressclass'];
  433.             }
  434.             if (strlen(trim($progress['progresssize']['bgcolor'])) > 0) {
  435.                 $structure['progress']['background-color'] = $progress['progresssize']['bgcolor'];
  436.             }
  437.             if (strlen(trim($progress['progresssize']['width'])) > 0) {
  438.                 $structure['progress']['width'] = $progress['progresssize']['width'];
  439.             }
  440.             if (strlen(trim($progress['progresssize']['height'])) > 0) {
  441.                 $structure['progress']['height'] = $progress['progresssize']['height'];
  442.             }
  443.             $structure['progress']['auto-size'] = ($progress['autosize'] == '1');
  444.  
  445.             $ui->setProgressAttributes($structure['progress']);
  446.             $orient = ($progress['shape'] == '1') ? HTML_PROGRESS_BAR_HORIZONTAL : HTML_PROGRESS_BAR_VERTICAL;
  447.             $ui->setOrientation($orient);
  448.             $ui->setFillWay($progress['way']);
  449.  
  450.             /* Page 2: Cell attributes ******************************************************/
  451.             if (strlen(trim($progress['cellid'])) > 0) {
  452.                 $structure['cell']['id'] = $progress['cellid'];
  453.             }
  454.             if (strlen(trim($progress['cellclass'])) > 0) {
  455.                 $structure['cell']['class'] = $progress['cellclass'];
  456.             }
  457.             if (strlen(trim($progress['cellvalue']['min'])) > 0) {
  458.                 $bar->setMinimum(intval($progress['cellvalue']['min']));
  459.             }
  460.             if (strlen(trim($progress['cellvalue']['max'])) > 0) {
  461.                 $bar->setMaximum(intval($progress['cellvalue']['max']));
  462.             }
  463.             if (strlen(trim($progress['cellvalue']['inc'])) > 0) {
  464.                 $bar->setIncrement(intval($progress['cellvalue']['inc']));
  465.             }
  466.             if (strlen(trim($progress['cellsize']['width'])) > 0) {
  467.                 $structure['cell']['width'] = $progress['cellsize']['width'];
  468.             }
  469.             if (strlen(trim($progress['cellsize']['height'])) > 0) {
  470.                 $structure['cell']['height'] = $progress['cellsize']['height'];
  471.             }
  472.             if (strlen(trim($progress['cellsize']['spacing'])) > 0) {
  473.                 $structure['cell']['spacing'] = $progress['cellsize']['spacing'];
  474.             }
  475.             if (strlen(trim($progress['cellsize']['count'])) > 0) {
  476.                 $ui->setCellCount(intval($progress['cellsize']['count']));
  477.             }
  478.             if (strlen(trim($progress['cellcolor']['active'])) > 0) {
  479.                 $structure['cell']['active-color'] = $progress['cellcolor']['active'];
  480.             }
  481.             if (strlen(trim($progress['cellcolor']['inactive'])) > 0) {
  482.                 $structure['cell']['inactive-color'] = $progress['cellcolor']['inactive'];
  483.             }
  484.             if (strlen(trim($progress['cellfont']['family'])) > 0) {
  485.                 $structure['cell']['font-family'] = $progress['cellfont']['family'];
  486.             }
  487.             if (strlen(trim($progress['cellfont']['size'])) > 0) {
  488.                 $structure['cell']['font-size'] = $progress['cellfont']['size'];
  489.             }
  490.             if (strlen(trim($progress['cellfont']['color'])) > 0) {
  491.                 $structure['cell']['color'] = $progress['cellfont']['color'];
  492.             }
  493.             $ui->setCellAttributes($structure['cell']);
  494.  
  495.             /* Page 3: Border attributes ****************************************************/
  496.             if (strlen(trim($progress['borderclass'])) > 0) {
  497.                 $structure['border']['class'] = $progress['borderclass'];
  498.             }
  499.             if (strlen(trim($progress['borderstyle']['width'])) > 0) {
  500.                 $structure['border']['width'] = $progress['borderstyle']['width'];
  501.             }
  502.             if (strlen(trim($progress['borderstyle']['style'])) > 0) {
  503.                 $structure['border']['style'] = $progress['borderstyle']['style'];
  504.             }
  505.             if (strlen(trim($progress['borderstyle']['color'])) > 0) {
  506.                 $structure['border']['color'] = $progress['borderstyle']['color'];
  507.             }
  508.             $ui->setBorderAttributes($structure['border']);
  509.  
  510.             /* Page 4: String attributes ****************************************************/
  511.             if (strlen(trim($progress['stringid'])) > 0) {
  512.                 $structure['string']['id'] = $progress['stringid'];
  513.             }
  514.             if (strlen(trim($progress['stringsize']['width'])) > 0) {
  515.                 $structure['string']['width'] = $progress['stringsize']['width'];
  516.             }
  517.             if (strlen(trim($progress['stringsize']['height'])) > 0) {
  518.                 $structure['string']['height'] = $progress['stringsize']['height'];
  519.             }
  520.             if (strlen(trim($progress['stringsize']['bgcolor'])) > 0) {
  521.                 $structure['string']['background-color'] = $progress['stringsize']['bgcolor'];
  522.             }
  523.             if (strlen(trim($progress['stringalign'])) > 0) {
  524.                 $structure['string']['align'] = $progress['stringalign'];
  525.             }
  526.             if (strlen(trim($progress['stringvalign'])) > 0) {
  527.                 $structure['string']['valign'] = $progress['stringvalign'];
  528.             }
  529.             if (strlen(trim($progress['stringfont']['family'])) > 0) {
  530.                 $structure['string']['font-family'] = $progress['stringfont']['family'];
  531.             }
  532.             if (strlen(trim($progress['stringfont']['size'])) > 0) {
  533.                 $structure['string']['font-size'] = $progress['stringfont']['size'];
  534.             }
  535.             if (strlen(trim($progress['stringfont']['color'])) > 0) {
  536.                 $structure['string']['color'] = $progress['stringfont']['color'];
  537.             }
  538.             $ui->setStringAttributes($structure['string']);
  539.  
  540.     } // end-if-no-model
  541.  
  542.         return $bar;
  543.     }
  544. }
  545. ?>